package reflect;

import socket.Client;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Scanner;

public class ReflectDemo1 {
    public static void main(String[] args) {
        //Class cls = ArrayList.class;
        Class cls = null;
        Scanner scan = new Scanner(System.in);
        try {
            //cls = Class.forName("java.util.ArrayList");
            String classname = scan.nextLine();
            cls = Class.forName(classname);
        } catch (ClassNotFoundException e) {
        }
        String name = cls.getName();
        System.out.println(name);
        name = cls.getSimpleName();
        System.out.println(name);
        Package pack = cls.getPackage();
        System.out.println(pack.getName());
        Method[] methods = cls.getMethods();
        System.out.println("一共"+methods.length+"个方法");
        for (Method method:methods){
            System.out.println(method.getName());
        }
    }
}
